package com.tomecode.tools.maven.settings.model;

/**
 * 
 * abstract class for {@link PluginRepository} and {@link Repository}
 * 
 * @author Tomas Frastia
 * @see http://www.tomecode.com or
 *      http://code.google.com/p/maven-settings-editor/
 * 
 */
public abstract class AbstractRepository {
	/**
	 * A unique identifier for a repository.
	 */
	protected String id;
	/**
	 * The url of the repository.
	 */
	protected String url;
	/**
	 * Human readable name of the repository.
	 */
	protected String name;
	/**
	 * How to handle downloading of releases from this repository
	 */
	protected Release releases;
	/**
	 * How to handle downloading of snapshots from this repository
	 */
	protected Snapshot snapshots;
	/**
	 * The type of layout this repository uses for locating and storing
	 * artifacts - can be "legacy" or "default".
	 */
	protected Layout layout;

	public AbstractRepository() {
		snapshots = new Snapshot();
		releases = new Release();
	}

	public final String getId() {
		return id;
	}

	public final void setId(String id) {
		this.id = id;
	}

	public final String getUrl() {
		return url;
	}

	public final void setUrl(String url) {
		this.url = url;
	}

	public final Release getReleases() {
		return releases;
	}

	public final Snapshot getSnapshots() {
		return snapshots;
	}

	public final void setReleases(Release releases) {
		this.releases = releases;
	}

	public final void setSnapshots(Snapshot snapshots) {
		this.snapshots = snapshots;
	}

	public final String getName() {
		return name;
	}

	public final void setName(String name) {
		this.name = name;
	}

	public final Layout getLayout() {
		return layout;
	}

	public final void setLayout(String layout) {
		this.layout = Layout.parse(layout);
	}

	public final void setLayout(Layout layout) {
		this.layout = layout;
	}

}
